Skip to content

Accept valid differing solver witnesses; drop ABA shape property deadline - #97

Merged
ctoth merged 4 commits into
mainfrom
fix/solver-diff-witnesses
Sep 27, 2026
Merged

ctoth merged 4 commits into
mainfrom
fix/solver-diff-witnesses

Conversation

@ctoth

@ctoth ctoth commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Fixes two issues, one commit each.

#73: solver differential helper rejected different valid witnesses

assert_solver_results_agree required both solvers to return the same single-extension witness and the same acceptance certificates. Solvers are allowed to return any valid one. On the stage framework from the issue, native returns {a} and SAT returns {c}, which are both stage extensions (Dvorak et al. 2014, Def 3), yet the helper reported a disagreement.

The helper now takes two optional keyword arguments: reference_extensions, the full set of extensions for the semantics, and query.

  • Differing witnesses: they agree when each one is in reference_extensions.
  • Acceptance certificates: a credulous witness must also contain the query, and a skeptical counterexample must omit it.
  • Still checked strictly: the acceptance answer itself, and whether an extension exists at all.
  • No reference set: identical witnesses still agree. Differing witnesses fail with a message saying that reference_extensions is needed to judge them.

Tests are in tests/solving/test_solver_differential_witnesses.py:

  • the issue's reproduction, run on the real native and SAT backends;
  • controls: a non-extension witness, a disagreement about existence, a witness missing the query, and differing answers all fail.

#95: ABA shape property tests failed on the Hypothesis deadline

These property tests check shape invariants, not speed, but they ran under Hypothesis's 200 ms per-example deadline. Some generated frameworks take several hundred milliseconds: observed failures took 214.87, 251.43 and 286.03 ms, and typical runtimes were 0-611 ms. So the tests failed intermittently with DeadlineExceeded whenever the machine was busy.

The module now shares one settings(max_examples=40, deadline=None) object across its tests. max_examples is the same as before, and the global Hypothesis default is not changed.

Closes #73
Closes #95

🤖 Generated with Claude Code

https://claude.ai/code/session_01V4tAVyyKcs1sYcsEzL7Bzg

ctoth and others added 4 commits September 27, 2026 02:00
The helper required identical single-extension witnesses and acceptance
certificates, so native {a} and SAT {c}, both stage extensions, were
reported as a semantic disagreement. Witnesses are choices: differing
ones now agree when each is an extension in reference_extensions (and,
for acceptance, contains or omits the query as required). Answers and
extension existence must still match, and differing witnesses without a
reference set fail with an explicit message.

Closes #73

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V4tAVyyKcs1sYcsEzL7Bzg
These properties check shape invariants, not speed, but ran under
Hypothesis's 200 ms deadline while some generated frameworks take several
hundred ms (observed 251-286 ms failures, 0-611 ms typical runtimes), so
they failed with DeadlineExceeded under load. The module now uses one
settings object with deadline=None and the same max_examples=40; the
global Hypothesis default is unchanged.

Closes #95

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V4tAVyyKcs1sYcsEzL7Bzg
@ctoth
ctoth merged commit 0ae0829 into main Sep 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant